<template>
	<el-dialog title="系统日志" :close-on-click-modal="false" :visible.sync="visible" @close="onClose" width="60%" >
		<div class="dialogDiv" v-html="show" style="height: 600px;overflow: auto;">
		</div> 
	</el-dialog>
</template>

<script>
	import {
		getSysLog
	} from '@/api/system/sysLog/sysLog.js'
	export default {
		created: function() {

		},
		mounted: function() {

		},
		data() {
			return {
				visible: false,
				show:''
			}
		},
		methods: {
			init(logName) {
				this.visible = true
				this.showLog(logName);
			},
			onClose() {
				this.show=''
			},
			showLog(logName){
				getSysLog(logName).then(data=>{
					if(data.code=='0000'){
						this.show = data.data.replace(/\n/g,"<br/>").replace(/\t/g,"&emsp;&emsp;");
					}else{
						this.$message.error(data.msg)
					}
				})
			},
		}
	}
</script>

<style>
.dialogDiv::-webkit-scrollbar {/*滚动条整体样式*/
	width: 10px;     /*高宽分别对应横竖滚动条的尺寸*/
	height: 1px;
}
.dialogDiv::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
	border-radius: 10px;
	 -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
	background: #535353;
}
.dialogDiv::-webkit-scrollbar-track {/*滚动条里面轨道*/
	-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
	border-radius: 10px;
	background: #EDEDED;
}
</style>

